/**
 * 
 * @author bigk
 * @version 0.8.5
 * 
 * 
 * Copyright (C) 2012  bigktheone@gmail.com

 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.

 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
 */
package bigk.pluzzdl;

import android.util.Log;
import android.widget.TextView;

public class Logger {
	
	private String m_name;
	private int m_level=0;
	
	
	public static Logger getLogger(String name) {
		return new Logger(name);
	}
	
	private Logger(String name) {
		m_name = name;
	}
	
	public void setLevel(int level) {
		m_level = level;
	}
	
	public void log(int level, String msg) {
		if (level>=m_level) {
			switch (level) {
			case Level.SEVERE :
				Log.e(m_name, msg);
				break;
			case Level.WARNING :
				Log.w(m_name, msg);
				break;
			case Level.INFO :
				Log.i(m_name, msg);
				break;
			case Level.FINEST :
				Log.d(m_name, msg);
				break;
			default:
				Log.i(m_name,msg);
			}
		}
			
	}

	
	
}
